package cn.wolfcode.shop.goodsapi.feign;

import cn.wolfcode.shop.goodsapi.domain.Good;
import cn.wolfcode.shop.goodsapi.hystrix.GoodsFeignHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@FeignClient(name = "goods-server",fallback = GoodsFeignHystrix.class)
public interface GoodsFeignApi {


    @RequestMapping("/queryByIds")
    @ResponseBody
    List<Good> findByIds(@RequestParam("ids") List<Long> ids);

    @RequestMapping("/queryById")
    @ResponseBody
    Good findById(@RequestParam("goodId")Long goodId);

    @RequestMapping("/updataById")
    @ResponseBody
    int updataById(Long goodId);
}
